#include <repository/employee/attendance_record_repository.h>

using namespace model;

// CRUD Operations
insert_ret_type AttendanceRecordRepository::create(
  const AttendanceRecordDTO& attendance_record_dto)
{
  return _insert(attendance_record_dto);
};

update_ret_type
AttendanceRecordRepository::updateById(const in_id_type id,
                                       const AttendanceRecordDTO& dto)
{
  return _update(dto, db::attendance_record{}.id == dto.id);
};

delete_ret_type AttendanceRecordRepository::removeById(const in_id_type id)
{
  return _remove(db::attendance_record{}.id == id);
}

// Custom Queries
select_ret_type<AttendanceRecordDTO> AttendanceRecordRepository::getAll()
{
  return _select(db::attendance_record{}.id >= 0);
}

select_ret_type<AttendanceRecordDTO>
AttendanceRecordRepository::getByPage(int page_size, int offset)
{
  return _select_from(db::attendance_record{}.id >= 0, page_size, offset);
}

count_type AttendanceRecordRepository::count()
{
  return _countById();
}

// 其他方法实现...
